package org.microframework.cloud.files.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * MinIO配置属性类
 */
@Data
@ConfigurationProperties(prefix = "minio")
public class MinioProperties {

    /**
     * MinIO服务端点
     */
    private String endpoint;

    /**
     * 访问密钥
     */
    private String accessKey;

    /**
     * 密钥
     */
    private String secretKey;

    /**
     * 存储桶配置
     */
    private Bucket bucket = new Bucket();

    /**
     * 是否启用MinIO
     */
    private boolean enabled = true;

    /**
     * 是否使用HTTPS
     */
    private boolean secure = false;

    /**
     * 连接超时时间(ms)
     */
    private int connectTimeout = 10000;

    /**
     * 写入超时时间(ms)
     */
    private int writeTimeout = 60000;

    /**
     * 读取超时时间(ms)
     */
    private int readTimeout = 10000;

    /**
     * 存储桶配置
     */
    @Data
    public static class Bucket {
        /**
         * 默认存储桶
         */
        private String defaultBucket = "micro-files";

        /**
         * 公共存储桶
         */
        private String publicBucket = "micro-files-public";

        /**
         * 临时存储桶
         */
        private String tmpBucket = "micro-files-tmp";

        public String getDefault() {
            return defaultBucket;
        }

        public void setDefault(String defaultBucket) {
            this.defaultBucket = defaultBucket;
        }

        public String getPublic() {
            return publicBucket;
        }

        public void setPublic(String publicBucket) {
            this.publicBucket = publicBucket;
        }

        public String getTmp() {
            return tmpBucket;
        }

        public void setTmp(String tmpBucket) {
            this.tmpBucket = tmpBucket;
        }
    }
} 